<?php
Sub pace_control_command( $KeyFlags,$id )
IF (GetLapperVar("ShortTime") >= GetCurrentPlayerVar( "control_commands"))
THEN
$time_splitted = SplitToArray( GetLapperVar("ShortTime"),":" ); #split ShortTime into an array
$time_splitted[1] = $time_splitted[1] + 1; #add one minute to the current minutes
# Check if minutes has value 60 or above. If so, raise hours by one and lower minutes by sixty
IF ($time_splitted[1] >= 60)
THEN
$time_splitted[0] = $time_splitted[0] + 1;
$time_splitted[1] = $time_splitted[1] - 60;
ENDIF
# Check if hours has value 24. If so, reduce hours by 24
IF ($time_splitted[0] == 24)
THEN
$time_splitted[0] = $time_splitted[0] - 24;
ENDIF
# Merge hours and minutes into one value
$pace_control = "" . $time_splitted[0] . ":" . $time_splitted[1];
# Set player var 'control_command' to the new time stamp
# Set player var 'control_command_allowd' to "yes"
SetCurrentPlayerVar( "control_commands", $pace_control );
SetCurrentPlayerVar( "control_commands_allowed", "yes" );
ELSE
# Set player var 'control_command_allowd' to "no"
SetCurrentPlayerVar( "control_commands_allowed", "no" );
ENDIF
EndSub
?>
<?php
CASE "!test":
pace_control_command( 0,0 );
IF (GetCurrentPlayerVar( "control_commands_allowed" ) == "yes" )
THEN
MyTest();
ELSE
PrivMsg("^1You have to wait until it is ^3(" . GetCurrentPlayerVar( "control_commands") . ")^1 , to be able to execute this command");
ENDIF
BREAK;
?>
<?php
IF (GetLapperVar("ShortTime") >= GetCurrentPlayerVar( "control_commands"))
THEN
$time_splitted = SplitToArray( GetLapperVar("ShortTime"),":" ); #split ShortTime into an array
$time_splitted[1] = $time_splitted[1] + 1; #add one minute to the current minutes
# Check if minutes has value 60 or above. If so, raise hours by one and lower minutes by sixty
IF ($time_splitted[1] >= 60)
THEN
$time_splitted[0] = $time_splitted[0] + 1;
$time_splitted[1] = $time_splitted[1] - 60;
ENDIF
# Check if hours has value 24. If so, reduce hours by 24
IF ($time_splitted[0] == 24)
THEN
$time_splitted[0] = $time_splitted[0] - 24;
ENDIF
# Merge hours and minutes into one value
$pace_control_time = "" . $time_splitted[0] . ":" . $time_splitted[1];
# Set player var 'control_command' to the new time stamp
SetCurrentPlayerVar( "control_commands", $pace_control_time );
?>
<?php
ELSE
PrivMsg("^1You have to wait until it is ^3(" . GetCurrentPlayerVar( "control_commands") . ")^1 , to be able to execute a command");
ENDIF
?>
<?php
openGlobalButton( "yetkiligrs_".$counter,1,195,20,4,1,10,36,"^T^7Moderatör: " .GetCurrentPlayerVar( "NickName")."");
?>
$default_top_bottom=195;
IF ($counter == 0)
THEN
$top_bottom=$default_top_bottom
ELSE
$new_position=$counter*5;
$top_bottom=$default_top_bottom-$new_position;
ENDIF
<?php
openGlobalButton( "yetkiligrs_".$counter,1,$top_bottom,20,4,1,10,36,"^T^7Moderatör: " .GetCurrentPlayerVar( "NickName")."");
?>
<?php
openGlobalButton( "yetkiligrs_".$userName,1,$top_bottom,20,4,1,10,36,"^T^7Moderatör: " .GetCurrentPlayerVar( "NickName")."");
?>
Changes from v5.924 to 5.925
1. Add new function to open private button for another player
Syntax :
openButton( username, idOfButton, left, top, width, height, interline, secondDisplayed, style, text[,optional_backCall] );
2. Add new function to close private button for another player
Syntax :
closeButton( username, idOfButton );
<?php
CatchEvent OnMSO( $userName, $text ) # Player event
$idxOfFirtsSpace = indexOf( $text, " ");
IF( $idxOfFirtsSpace == -1 ) THEN
$command = $text;
$argv = "";
ELSE
$command = subStr( $text,0,$idxOfFirtsSpace );
$argv = trim( subStr( $text,$idxOfFirtsSpace ) );
ENDIF
SWITCH( $command )
CASE "!ctrl":
control_lapper( 0,0 );
BREAK;
ENDSWITCH
EndCatchEvent
Sub control_lapper( $KeyFlags,$id )
### Set initial values for left/right and top/bottom coordinates ###
$left_right_control = 54;
$top_bottom_control = 50;
### End ###
openPrivButton( "control_term_lapper",$left_right_control+1,$top_bottom_control+56,45,5,5,-1,32, "^3Terminate Lapper", control_term_lapper);
openPrivButton( "control_reload_lapper",$left_right_control+46,$top_bottom_control+56,45,5,5,-1,32, "^3Reload Lapper", control_reload_lapper);
EndSub
Sub control_term_lapper( $KeyFlags,$id )
IF ( UserIsAdmin( $userName ) == 1 )
THEN
globalMsg( langEngine( "%{main_lapclose}%" ) );
termLapper();
ENDIF
EndSub
Sub control_reload_lapper( $KeyFlags,$id )
IF ( UserIsAdmin( $userName ) == 1 )
THEN
privMsg("Restarting and reloading config!");
reload();
ENDIF
EndSub
?>